subroutine  grides
use var
implicit none

    integer j,i
    real(8) pi
    
    select case(c_init_case)  
    case(1,2,3,4)
        t_end = 0.1d0
        CFL=0.5d0
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(5)
        t_end = 0.4d0
        CFL=0.6d0
        
        upx=2.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
        
    case(6)
        t_end = 2.d0
        CFL=0.6d0
        
        upx=1.d0
        downx=-1.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(7)
        t_end = 1.d0
        CFL=0.5d0
        
        upx=0.5d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(8)
        t_end = 0.4d0
        CFL=0.5d0
        
        upx=2d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(9)
        t_end = 8.25d0
        CFL=0.5d0
        
        upx=0.5d0
        downx=-0.5d0
        upy=10.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(10)
        t_end = 8.25d0
        CFL=0.5d0
        
        upx=10.d0
        downx=0.d0
        upy=0.5d0
        downy=-0.5d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(11)
        t_end = 0.4d0
        CFL=0.5d0
        
        upx=1d0
        downx=0.d0
        upy=2.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(12)
        !t_end=0.14
        t_end = 1.95d0
        gx=0.d0
        gy=1.d0
        CFL=0.5d0
        
        upx=1.d0/4.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(13)
        !t_end=0.14
        t_end = 1.95d0
        gx=0.d0
        gy=1.d0
        CFL=0.5d0
        
        upx=1.d0/4.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(14)
        !t_end=0.14
        t_end = 0.5d0
        gx=0.d0
        gy=1.d0
        CFL=0.5d0
        
        upx=1.d0/4.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(15)
        !t_end=0.14
        t_end = 0.25d0
        CFL=0.5d0
        
        upx=1.d0/2.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(16)
        !t_end=0.14
        t_end = 0.25d0
        CFL=0.5d0
        
        upx=1.d0/2.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(17)
        !t_end=0.14
        t_end = 0.4d0
        gx=1.d0
        gy=0.d0
        CFL=0.5d0
        
        upx=2.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(18)
        !t_end=0.14
        t_end = 0.4d0
        gx=0.d0
        gy=1.d0
        CFL=0.5d0
        
        upx=1.d0
        downx=0.d0
        upy=2.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(19)
        !t_end=0.14
        t_end = 1.8d0
        CFL=0.5d0
        
        upx=10.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(20)!2Dperiodic vortex propagation problem
        t_end=10.d0
        
        upx=10.d0
        downx=0.d0
        upy=10.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(21)
        t_end=0.038d0
        CFL=0.45d0
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(22)
        t_end = 0.2d0
        CFL=0.5d0
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
    case(23)
        t_end = 0.13d0
        CFL=0.5d0
        
        upx=1.d0
        downx=0.d0
        upy=1.d0
        downy=0.d0
        
        pi=2.d0*dasin(1.d0)
        dx=(upx-downx)/dble(gridsx)
        dy=(upy-downy)/dble(gridsy)
    
        do j=0,gridsy
            do i=0,gridsx
                x(i,j)=downx+dble(i)*dx
                y(i,j)=downy+dble(j)*dy
            enddo        
        end do
    
        do j=1,gridsy
            do i=1,gridsx
                xc(i,j)=downx+dble(i)*dx-0.5d0*dx
                yc(i,j)=downy+dble(j)*dy-0.5d0*dy
            enddo        
        end do
   
        
    endselect


end subroutine